#define _CRT_SECURE_NO_WARNINGS 1


namespace lim
{
template<class Iterator, class Ref, class Ptr>
struct Reverse_iterator
{

    typedef Reverse_iterator<Iterator, Ref, Ptr> Self;

    Reverse_iterator(Iterator it = nullptr)
        :_it(it)
    {

    }
    Ref operator*()
    {
        Iterator it = _it;
        return *(--it);
    }

    Ptr operator->()
    {

        return _it.operator->();
    }

    Self& operator++ ()
    {
        --_it;
        return *this;
    }

    Self& operator++(int)
    {
        Iterator it = _it;
        --_it;
        return *this;
    }

    Self& operator-- ()
    {
        ++_it;
        return *this;
    }

    Self& operator--(int)
    {
        Iterator it = _it;
        ++_it;
        return *this;
    }
    bool operator==(const Self& it)
    {
        return _it == it;
    }
    bool operator!=(const Self& it)
    {
        return _it != it._it;
    }
    Iterator _it;

};

}


